﻿@model IPagedList<MvcGMaps.Models.Marker>
@using PagedList;
@using System.Globalization;

<link href="/Content/PagedList.css" rel="stylesheet" type="text/css" />
@if (Model.Count > 0)
{
    <table class="table table-hover table-bordered table-condensed">
        <caption class="caption">Результаты поиска</caption>
        <tbody>
            @foreach (var marker in Model)
            {
                <tr onclick="showOnMap(@marker.Latitude.ToString(CultureInfo.InvariantCulture), @marker.Longitude.ToString(CultureInfo.InvariantCulture))">
                    <td>
                        Тип: @marker.MarkerType.TypeName<br />
                        Статус: @marker.Status.StatusName<br />
                        Дата: @marker.AddedDate.ToShortDateString()
                    </td>
                </tr>
            }
        </tbody>
    </table>

    <p>Страница @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) из @Model.PageCount</p>
    <input id="btnPrevious" type="button" class="btn btn-primary btn-sm" value="Назад" onclick="getPage(@(Model.PageNumber-1))" @(Model.PageNumber == 1 ? " disabled" : "") />
    <input id="btnNext" type="button" class="btn btn-primary btn-sm" value="Вперед" onclick="getPage(@(Model.PageNumber+1))" @(Model.PageNumber == @Model.PageCount ? " disabled" : "") />
}
else
{
    <p>Ничего не нашли...</p>
}